package com.jp.knowledge.my.business;

import com.jp.knowledge.R;
import com.jp.knowledge.activity.BaseFragment;
import com.jp.knowledge.my.fragment.MyReeceFragment;
import com.jp.knowledge.my.model.MyReeceModel;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author gzejia 978862664@qq.com
 */
public class MyReeceBusiness {

    public List<BaseFragment> getFragments() {
        List<BaseFragment> fragments = new ArrayList<>();
        MyReeceFragment reeceGetFragment = new MyReeceFragment();
        reeceGetFragment.setReeceType(MyReeceFragment.REECE_GET);
        fragments.add(reeceGetFragment);

        MyReeceFragment reeceSendFragment = new MyReeceFragment();
        reeceSendFragment.setReeceType(MyReeceFragment.REECE_SEND);
        fragments.add(reeceSendFragment);

        return fragments;
    }

    public List<String> getTabStr() {
        String[] tabStr = {"我收到的", "我发出的"};
        return Arrays.asList(tabStr);
    }

    /**
     * @return 假定红包数据
     */
    public List<MyReeceModel> getReeceData() {
        String[] date = {"今天", "今天", "昨天", "周六", "周四"};
        String[] time = {"12:30", "11:20", "20:30", "11.20", "11.18"};
        float[] money = {78.88f, 39.80f, 100f, 58.5f, 2000f};

        List<MyReeceModel> models = new ArrayList<>();
        for (int i = 0, k = date.length; i < k; i++) {
            MyReeceModel model = new MyReeceModel();
            model.setDate(date[i]);
            model.setTime(time[i]);
            model.setMoney(money[i]);
            model.setHeaderUrl(R.mipmap.ic_my_header);
            model.setHind("仿支付宝样式，异常红包");
            models.add(model);
        }
        return models;
    }
}
